home *** CD-ROM | disk | FTP | other *** search
/ Flybox Trout (Edition 1) / Flybox Trout (Edition 1).iso / Setup / Support / FlyBox.exe / FlyBox.dxr / 00007_AddAnecdote.ls < prev    next >
Encoding:
Text File  |  2002-04-15  |  525 b   |  18 lines

  1. global DBPath
  2.  
  3. on exitFrame me
  4.   db = DGOpenDatabase(DBPath & "FlyBox.mdb", 0, 0, ";PWD=StopLooking")
  5.   theString = getVariable(sprite(1), "Anecdote")
  6.   FlyID = getVariable(sprite(1), "FlyID")
  7.   num = length(theString)
  8.   repeat with i = 1 to num
  9.     if theString.char[i] = "'" then
  10.       NewString = NewString & "''"
  11.       next repeat
  12.     end if
  13.     NewString = NewString & theString.char[i]
  14.   end repeat
  15.   DGExecute("INSERT INTO Anecdote (FlyID, Anecdote) VALUES (" & FlyID & ", '" & theString & "')", db)
  16.   DGClose(db)
  17. end
  18.